﻿using System;

namespace ATM_Pro
{
    class SoundAlarmService : IAlarmService
    {
        public string CameraCoveredWaveFileName { get; set; }
        public string ObjectLeftBehindWaveFileName { get; set; }

        public void NotifyCameraCovered()
        {
            PlayWave(CameraCoveredWaveFileName);
        }

        public void NotifyObjectLeftBehind()
        {
            PlayWave(ObjectLeftBehindWaveFileName);
        }

        private void PlayWave(string waveFile)
        {
            var player = new System.Media.SoundPlayer(waveFile);
            try
            {
                player.Play();
            }
            catch (Exception)
            {

            }

        }
    }
}